﻿function startShow()
{
  if(!advBox || !divs || divs.length < 1) return;

  if(++currItem >= divs.length) currItem = 0;
  if(currItem == 0)
    prevItem = divs.length - 1;
  else
    prevItem = currItem - 1;

  var currDiv = divs[currItem];
  var prevDiv = divs[prevItem];

  xPos = parseInt(currDiv.parentNode.offsetWidth);
  currDiv.style.left = xPos + "px";
  currDiv.style.display = "block";
  
  currDiv.style.zIndex = 2;
  prevDiv.style.zIndex = 1;

  slideDiv(prevItem, currItem);
}